Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 3 - Geometric Styles / Geometric Styles Reference
Functions / Getting and Setting Style Attributes


GXSetStyleAttributes

You can use the GXSetStyleAttributes function to alter the style attributes for a particular style object.

void GXSetStyleAttributes(gxStyle target, 
                          gxStyleAttribute attributes);
target
A reference to the style object whose attributes you want to alter.
attributes

The new set of attributes.
DESCRIPTION
The GXSetStyleAttributes function sets the style attributes of the style object specified by the target parameter to be the attributes specified in the attributes parameter.

You can use this function in combination with the GXGetStyleAttributes function to set or clear single style attributes. For example, to clear the gxSourceGridStyle attribute of a style object referenced by the variable target, you could use this line of code:

GXSetStyleAttributes(target,
               GXGetStyleAttributes(target & ~gxSourceGridStyle);
To set the gxSourceGridStyle attribute, you could use this line of code:

GXSetStyleAttributes(target,
                GXGetStyleAttributes(target | gxSourceGridStyle);
To set the gxCenterFrameStyle attribute, you need to clear the gxInsideFrameStyle and gxOutsideFrameStyle attributes.

When you set a style's attributes using this function, you are effectively changing the style attributes for all shapes that share the style.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
style_is_nil 
inconsistent_parameters(debugging version)
parameter_out_of_range(debugging version)
Notices (debugging version) 
attributes_already_set 
SEE ALSO
For a discussion of style attributes, see "Style Attributes" on page 3-98.

For an example of pen placement, see "Manipulating Pen Width and Placement" beginning on page 3-51.

For an example of constraining shapes to grids, see "Constraining Shape Geometries to Grids" on page 3-40 and "Constraining Shapes to Device Grids" on page 3-42.

To examine the style attributes of a style object, use the GXGetStyleAttributes function, which is described on page 3-109.

To examine the style attributes of a style object associated with a particular shape, use the GXGetShapeStyleAttributes function, which is described in the next section. To alter the style attributes of a style object associated with a particular shape, use the GXSetShapeStyleAttributes function, which is described on page 3-113.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help